import React from "react"
import PropTypes from "prop-types"
import "../../assets/css/common.css"
import 'antd/dist/antd.css'
import 'antd-mobile/dist/antd-mobile.min.css'
import Header from "../base/Header.jsx"
//首页
const HeaderText=[
    {key:"/index",value:"输入信息"},
    {key:"/listView",value:"列表"},
    {key:"/details",value:"刷单详情页"}
]

class App extends  React.Component{
    constructor(props){
        super(props);
        this.state={
            headerText:HeaderText[0].value,
            bsParams:{
                platform:"淘宝",
                commodity_name:"",
                price:0,
                is_price:0,//0 未返本金 1 已返本金
                commission:0,
                is_commission:0,//0 未返佣金 1 已返佣金
                sign:0,//0 未签收 1 已签收
                pay:0,//0 未代付 1 代付
                insertTime:"",
                lastTime:"",
                commodity_href:"",
                business_nike:"",
                business_code:"",
                is_end:0,//0未完结 1 已完结
                shop_name:"",
                gift:""
            }
        }
    }
    checkHeaderText(pathName){
        HeaderText.forEach(value=>{
            if(value.key==pathName){
                this.setState({headerText:value.value})
            }
        })
        //this.props.history.push("/listView");
    }
    componentWillReceiveProps(nextProps){
        //可以监听到路由props.location.pathname的变化
        //console.log(nextProps);
        this.checkHeaderText(nextProps.location.pathname);
    }
    render(){
        return null;
    }
}
export default App
